package com.sina.weibo.view;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
//import android.widget.RelativeLayout.LayoutParams;
import android.widget.TextView;

import com.sina.weibo.R;
import com.sina.weibo.WeiboApplication;

public class BaseLayout extends RelativeLayout
{
  public static final int TYPE_BUTTON_GROUP = 0;
  public static final int TYPE_NORMAL = 1;
  public Button leftButton;
  public LinearLayout lyButtonGroup;
  public Button mButton1;
  public Button mButton2;
  public Button mButton3;
  public RelativeLayout progressButton;
  public Button rightButton;
  public TextView tvInfo;

  public BaseLayout(Context paramContext, int paramInt)
  {
    super(paramContext);
    LayoutInflater localLayoutInflater = (LayoutInflater)paramContext.getSystemService("layout_inflater");
    View localView1 = localLayoutInflater.inflate(R.layout.titlebar, null);
    Object localObject = null;
    switch (WeiboApplication.getTitleDisplayMode())
    {
    default:
    case 0:
    case 1:
    case 2:
    }
    while (true)
    {
      ((RelativeLayout.LayoutParams)localObject).addRule(10);
      addView(localView1, (ViewGroup.LayoutParams)localObject);
      View localView2 = localLayoutInflater.inflate(paramInt, null);
      RelativeLayout.LayoutParams localLayoutParams = new RelativeLayout.LayoutParams(-1, -1);
      localLayoutParams.addRule(3, 2131624129);
      addView(localView2, localLayoutParams);
      Button localButton1 = (Button)findViewById(2131624130);
      this.leftButton = localButton1;
      Button localButton2 = (Button)findViewById(2131624137);
      this.rightButton = localButton2;
      TextView localTextView1 = (TextView)findViewById(2131624131);
      this.tvInfo = localTextView1;
      LinearLayout localLinearLayout = (LinearLayout)findViewById(2131624132);
      this.lyButtonGroup = localLinearLayout;
      TextView localTextView2 = (TextView)findViewById(2131624131);
      this.tvInfo = localTextView2;
      Button localButton3 = (Button)findViewById(2131624133);
      this.mButton1 = localButton3;
      Button localButton4 = (Button)findViewById(2131624134);
      this.mButton2 = localButton4;
      Button localButton5 = (Button)findViewById(2131624135);
      this.mButton3 = localButton5;
      RelativeLayout localRelativeLayout = (RelativeLayout)findViewById(2131624136);
      this.progressButton = localRelativeLayout;
      return;
      localObject = new RelativeLayout.LayoutParams(-1, 69);
      continue;
      localObject = new RelativeLayout.LayoutParams(-1, 45);
      continue;
      localObject = new RelativeLayout.LayoutParams(-1, 35);
    }
  }

  public void setButtonTypeAndInfo(int paramInt, String paramString1, String paramString2, String paramString3)
  {
    this.lyButtonGroup.setVisibility(8);
    Resources localResources = getResources();
    switch (paramInt)
    {
    default:
    case 1:
    case 0:
    }
    while (true)
    {
      return;
      if (TextUtils.isEmpty(paramString1))
        this.leftButton.setVisibility(8);
      while (true)
      {
        if (!TextUtils.isEmpty(paramString2))
          setTitle(paramString2);
        if (!TextUtils.isEmpty(paramString3))
          break label165;
        this.rightButton.setVisibility(8);
        break;
        String str1 = localResources.getString(2131427373);
        if (paramString1.equalsIgnoreCase(str1))
        {
          Button localButton1 = this.leftButton;
          Drawable localDrawable1 = localResources.getDrawable(2130838084);
          localButton1.setBackgroundDrawable(localDrawable1);
          continue;
        }
        Button localButton2 = this.leftButton;
        Drawable localDrawable2 = localResources.getDrawable(2130838069);
        localButton2.setBackgroundDrawable(localDrawable2);
        this.leftButton.setText(paramString1);
      }
      label165: String str2 = localResources.getString(2131427368);
      if (paramString3.equalsIgnoreCase(str2))
      {
        Button localButton3 = this.rightButton;
        Drawable localDrawable3 = localResources.getDrawable(2130838081);
        localButton3.setBackgroundDrawable(localDrawable3);
        continue;
      }
      String str3 = localResources.getString(2131427374);
      if (paramString3.equalsIgnoreCase(str3))
      {
        Button localButton4 = this.rightButton;
        Drawable localDrawable4 = localResources.getDrawable(2130838090);
        localButton4.setBackgroundDrawable(localDrawable4);
        continue;
      }
      String str4 = localResources.getString(2131427753);
      if (paramString3.equalsIgnoreCase(str4))
      {
        Button localButton5 = this.rightButton;
        Drawable localDrawable5 = localResources.getDrawable(2130838087);
        localButton5.setBackgroundDrawable(localDrawable5);
        this.rightButton.setText(paramString3);
        continue;
      }
      Button localButton6 = this.rightButton;
      Drawable localDrawable6 = localResources.getDrawable(2130838069);
      localButton6.setBackgroundDrawable(localDrawable6);
      this.rightButton.setText(paramString3);
      continue;
      this.leftButton.setVisibility(8);
      this.rightButton.setVisibility(8);
      this.tvInfo.setVisibility(8);
      this.lyButtonGroup.setVisibility(0);
    }
  }

  public void setTitle(String paramString)
  {
    this.tvInfo.setText(paramString);
  }
}